home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1 / Nebula One.iso / Communications / IBTip / Source / tip3.man < prev    next >
Encoding:
Text File  |  1995-06-12  |  8.8 KB  |  187 lines

  1. The program tip3 is a replacement for the tip that comes with the NeXT.  It
  2. includes a facility for doing xmodem, ymodem, and zmodem transfers by executing
  3. the programs /usr/local/bin/sz and /usr/local/bin/rz, which can be gotten from
  4. the next listings on BIX.
  5.  
  6. In addition, tip3 will recognize the start of a zmodem download (by looking for
  7. the beginning of the ZRQINIT sequence ^XB0) and automatically start the rz
  8. process.  Thus, on BIX, one can give BIX the download command, and the download
  9. of your SCRATCHPAD will happen automatically.
  10.  
  11. I wrote this utility primarily to communicate with BIX.  I also wanted to get
  12. experience with Objective-C.  Tip3 was the first Objective-C program I wrote,
  13. and has many things "hard-wired" that a truly friendly program would not.  For
  14. example, the programs (rz, sz) used to accomplish the file transfers must exist
  15. in the /usr/local/bin/ directory.  Also, the DELETE key is unconditionally
  16. translated to backspace-space-backspace, so that the DELETE key will work
  17. correctly on BIX.
  18.  
  19. I would most appreciate receiving any improvements made to tip3 (and I know
  20. there is much room for improvement).
  21.  
  22. Installation of tip3 is like installation of other utilities, (simply copy it
  23. into a directory in your PATH) except for one issue: the privilege of opening
  24. the serial port.  One way to obtain this privilege is for tip3 to have its
  25. setuid bit set and to be owned either by root or by the owner of /dev/cub (uucp
  26. on my system).  The other way is to chmod the permission bits of /dev/cub so
  27. that anyone can open it.
  28.  
  29. Following are usage notes:
  30.  
  31. SYNOPSIS
  32.       tip3 [file]
  33.  
  34. DESCRIPTION
  35.  
  36. Tip3 manages a full-duplex connection to a device, typically a modem.
  37. During operation, characters typed are sent to the device and characters
  38. received from the device are written to the screen.
  39.  
  40. Invoking tip3 without an argument will open the /dev/cub (Port B)
  41. device at 2400 bps.  With an argument tip3 will read and execute the
  42. commands in the named file, a line at a time.  The set of commands
  43. will be described below.  Most commands that can be executed from a
  44. file can also be executed interactively by pressing ~ (tilde) followed
  45. by a single character.  In the following table the corresponding tilde
  46. sequence is given in parentheses before the command name.  Some
  47. commands require more information, such as a file name or phone
  48. number.  When invoked interactively, these commands will prompt the
  49. user.  When invoked from a script file, the information must follow
  50. the command as arguments.  For example, to set the receive protocol to
  51. zmodem, one would interactively type ~p, answer the first prompt with
  52. "r" (for receive) and specify "z" for the protocol.  In a script file,
  53. one must write "protocol r z".  The commands are:
  54.  
  55.   (~^D) stop
  56.  
  57.     Quit the program.  This does not normally hang up the phone.  In many
  58.     cases, the session can be restarted.
  59.  
  60.   (~p) protocol
  61.  
  62.     Set the file transfer protocols for sending or receiving files.  The
  63.     program will prompt with
  64.        Enter direction [(s)end,(r)eceive]:"
  65.     for which protocol to set, and, after the user selects send or receive,
  66.     with
  67.       Enter desired send protocol [(x)modem,xmodem(1)k,(y)modem,(z)modem]:
  68.     Once the choice has been made, both send and receive protocols will be
  69.     displayed.
  70.  
  71.   (~^P) parity
  72.  
  73.     Set the parity to be sent to the remote host.  Some hosts require even or
  74.     odd parity.  BIX and most BBS's don't need any specific parity.  This only
  75.     affects the parity of characters sent to the host; the parity of incoming
  76.     characters is ignored.  The program will prompt with
  77.       Enter desired parity (even, odd, or none) [e,o,n]:
  78.     and will display the choice, once it has been made.
  79.  
  80.   (~s) send
  81.  
  82.     Send a file to the host using the currently selected "send protocol".  The
  83.     program will prompt for a file, and will check for its existence.  If the
  84.     file does not exist, the program will keep prompting until a good filename
  85.     is entered.  Responding with just a return will abort the send.
  86.  
  87.     After a valid file is established, the program will prompt for a command to
  88.     send to the host.  This string (with the trailing "return") will be sent to
  89.     the host just before calling sz to perform the file transfer.  Normally
  90.     this will be the command that would normally be typed to cause the host to
  91.     receive a file.  The purpose of doing this is to avoid the several second
  92.     pause waiting for the host protocol program to time out.
  93.  
  94.     An example upload, to BIX, is transcripted here (with annotations added):
  95.                                          --------comment---------------------
  96.       Rf:                               | BIX's prompt (user presses ~s)     |
  97.       Enter file to send:comment        | tip3 prompts for file (user enters |
  98.                                         |   filename "comment")              |
  99.       Enter command to send to host:up  | tip3 prompts for host command (user|
  100.                                         |   enters "up", the BIX command to  |
  101.                                         |   upload a file to the scratchpad  |
  102.                                          ------------------------------------
  103.       Sending comment, 8 blocks: Give your local XMODEM receive command now.
  104.       Sector   8  1k 
  105.                                          ------------------------------------
  106.                                         | The above is the output of sz, the |
  107.                                         | program that does the file transfer|
  108.                                         |                                    |
  109.       File transfer process ended       | tip3 gets control back from sz and |
  110.                                         |    is back in its normal mode      |
  111.       Rf:                               | BIX's prompt, after successful send|
  112.                                          ------------------------------------
  113.   (~r) receive 
  114.  
  115.     Receive a file from the host using the currently selected "receive
  116.     protocol".  If the receive protocol does not automatically obtain the file
  117.     name as part of the process, a file name will be prompted for.
  118.  
  119.     The command to cause the host to send the file should be typed in prior to
  120.     executing the receive command of tip3.  This is in contrast to the "send"
  121.     command.
  122.  
  123.   (~c) capture
  124.  
  125.     This toggles capture mode.  When capture mode is on, all characters sent
  126.     from the host are captured in a file as well as being displayed on the
  127.     screen.  Turning this on will prompt for a file name for capturing.  The
  128.     default is "tip.record".
  129.  
  130.     If the given file already exists, then the current session is appended to
  131.     it.  So it is safe to specify the same file over multiple sessions, or to
  132.     put a "capture fixed_filename" into a script.
  133.  
  134.   (~h) hangup
  135.  
  136.     This will attempt to hang up the phone, first by dropping DTR, then by
  137.     sending three tilde's (~~~), pausing, and issuing the Hayes command ATH0.
  138.     This Hayes sequence is entirely hardwired.
  139.  
  140.   (~e) readscript
  141.  
  142.     This reads and executes a script file (the e is for execute).  The file
  143.     name will be prompted for.  One script can call another.
  144.  
  145.   (~b) baudrate
  146.  
  147.     This allows the user to set the transmission speed of the serial port.  The
  148.     supported speeds are, in bits per second: 300, 1200, 2400, 4800, 9600.
  149.  
  150.        echo
  151.  
  152.     This will write the arguments to the screen.  This might be useful for
  153.     status messages.  Not very likely though.
  154.  
  155.        say
  156.  
  157.     This will send the arguments to the serial port, and thus either to the
  158.     modem or the remote host if the modem is "online".
  159.  
  160.   (~d) dial
  161.  
  162.     This command will prompt for a phone number to dial.  It assumes, like the
  163.     hangup command, that the modem accepts Hayes "AT" type commands, and
  164.     generates Hayes "verbose" responses (CONNECT, CONNECT 1200, CONNECT 2400,
  165.     NO CARRIER, BUSY, NO DIALTONE).  If the response from the modem is either
  166.     NO CARRIER or BUSY, then tip3 will pause a few seconds and try to dial
  167.     again.  If the response is one of the CONNECT ones, tip3 rings the
  168.     terminal's bell.
  169.  
  170.     To stop the redialing, press the ESCape key while tip3 is waiting for one
  171.     of the Hayes responses; tip3 will respond with "User aborted dialing" and
  172.     resume normal operations.
  173.  
  174.  
  175. BUGS
  176.  
  177. Too many things are hard-wired, like the hayes commands and responses, the
  178. serial port to use (/dev/cub), the location and name of the zmodem program, the
  179. initial protocols (xmodem 1k for sending, zmodem for receiving).
  180.  
  181. Also, tip3 does not prevent other programs from opening the serial device, the
  182. way tip does.  It is possible to start one instance of tip3 while another is
  183. running (say, from another Terminal).  In such cases the output from the modem
  184. gets split between the active tip3's.  There is nothing to prevent different
  185. users from running tip3 at the same time.  This really should be fixed, so I'll
  186. have to figure out someday how it is done.
  187.